package wan.moneybook.handler;

import java.util.StringTokenizer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import wan.moneybook.sql.SqlMapper;

import com.ibatis.sqlmap.client.SqlMapClient;

public class DeleteHandler implements Handler {

	@Override
	public String process(HttpServletRequest request,
			HttpServletResponse response) throws Throwable {

		SqlMapClient sqlMap = SqlMapper.getInstance();
		String seq = request.getParameter("seq");
		StringTokenizer st = new StringTokenizer(seq, "_");
		while (st.hasMoreTokens()) {
			sqlMap.delete("deleteRecord", Integer.parseInt(st.nextToken()));
		}
		return null;
	}
}
